version 13.1
**************************************************
*  Reproduction of the figures in:               *
*  The 2016 Austrian Presidential Election       *
*  A Tale of Three Divides                       *
**************************************************

cd "Yourpath"
import delimited austrian_presidential.csv, clear

generate bellen_per = vanderbellen * 100 / valid_ballots
generate log_density = log(density)


# delimit ;

graph twoway (lfit bellen_per log_density) 
(scatter bellen_per log_density, msymbol(smcircle) msize(medlarge) mcolor(black)),
legend(off)
graphregion(color(white))
ylabel(,nogrid angle(0)) ytitle("{bf:Votes for Van der Bellen (%)}"
" ", size(medium))  
xtitle(" " "{bf:District Population Density (logged)}" " ", size(medium))
xscale(noextend) 
yscale(noextend) ;

graph export figure2a_original.tif, width(3900) ;



# delimit ;

graph twoway (lfit bellen_per pop_change) 
(scatter bellen_per pop_change, msymbol(smcircle) msize(medlarge) mcolor(black)),
legend(off)
graphregion(color(white))
ylabel(,nogrid angle(0)) ytitle("{bf:Votes for Van der Bellen (%)}"
" ", size(medium))  
xtitle(" " "{bf:District Population Growth, 2011-2015 (%)}" " ", size(medium))
xscale(noextend) 
yscale(noextend) ;

graph export figure2b_original.tif, width(3900) ;
